﻿using System;

namespace Bookvar.ObjectModel
{
    [Serializable]
	public class RecoveredMapInfo
	{
		public Guid Key { get; set; }
		public string Name { get; set; }
		public string FileName { get; set; }

	    public bool HasFileName
	    {
	        get
	        {
                //HACK: if the file name is temporary the map is not previously saved
	            return !string.IsNullOrEmpty( FileName ) && !FileName.EndsWith( ".tmp", StringComparison.OrdinalIgnoreCase );
	        }
	    }

		public RecoveredMapInfo() : this( string.Empty, Guid.Empty, string.Empty )
		{
		}

		public RecoveredMapInfo( string fileName, Guid key, string name )
		{
			FileName = fileName;
			Key = key;
			Name = name;
		}
	}
}